import 'package:flutter_learn_vi/src/bean/bean_user.dart';

import 'bean_video_course.dart';

/// 创建人： Created by zhaoint
/// 创建时间：Created by  on 2020/7/23.
///
/// 创建人： Created by zhaoint
/// 创建时间：Created by  on 2020/9/25.
///
/// gongzhonghao biglead
/// https://study.163.com/instructor/1021406098.htm
/// https://blog.csdn.net/zl18603543572
/// https://www.toutiao.com/c/user/token/MS4wLjABAAAAYMrKikomuQJ4d-cPaeBqtAK2cQY697Pv9xIyyDhtwIM/

//教师与课程
class CourseAndTeacherBean {
  int id;
  int index;
  int trainId;

  int teacherUserId;
  String teacherContent;
  int teacherSignRecoderId;

  int timeNode = 12;

  int teacherPeriod = 0;
  String courseStatuesStr;

  String userCourseStatuesStr;

  /// 0 未上课  1 已上课
  int userCourseStatues = 0;

  //课程状态  0 未上课  1 正在上课中  2上课完成
  int courseStatues = 0;
  String beginTime;
  String endTime;
  UserBean userEntity;

  int finishLevelNumber = 0;
  int totalLevelNumber = 0;

  /// APP 显示用户的签到按钮

  bool showUserStartSign = false;
  bool showUserStartSignTips = true;
  String showUserStartSignStr = "";

  String showUserStartSignTips1 = "";
  String showUserStartSignTips2 = "";
  String showUserStartSignTips3 = "";

  ///使用随机码签到
  bool showUserCodeSign = false;

  ///使用随机码签退
  bool showUserCodeEndSign = false;

  /// APP 显示用户的签退按钮

  bool showUserEndSign = false;
  String showUserEndSignStr = "";
  bool showUserEndSignTips = true;

  String showUserEndSignTips1 = "";
  String showUserEndSignTips2 = "";
  String showUserEndSignTips3 = "";

  String noSignTips;

  /// APP 显示教师的开始上课按钮

  bool showTeacherStartSign = false;
  bool showTeacherStartTips = false;
  String showTeacherStartTips1 = "";

  /// APP 显示教师的结束上课的按钮

  bool showTeacherEndSign = false;
  bool showTeacherEndTips = false;
  String showTeacherEndTips1 = "";

  /// APP 显示教师的上课时间
  bool showTeacherTime = false;

  /// 用户的签到时间
  String userSignStartTime;

  /// 用户的签退时间
  String userSignEndTime;

  ///教师上课的签到记录的ID
  int signRecoderId;

  String teacherSignStartTime;
  String teacherSignEndTime;
  num signLocationDistance;

  double teacherLongitude;
  double teacherLlatitude;
  String teacherAddress;

  /// 上课使用的随机签到码
  String courseCode;
  int signUserNumber;

  ///强制使用位置
  bool isForceLocation = true;

  ///强制使用位置距离 m
  int forceLocation = 0;

  CourseAndTeacherBean.fromJson(Map<String, dynamic> map) {
    this.id = map["id"];
    this.trainId = map["trainId"];
    this.signLocationDistance = map["signLocationDistance"];
    this.index = map["index"];
    this.teacherUserId = map["teacherUserId"];
    this.teacherContent = map["teacherContent"];
    this.teacherSignRecoderId = map["teacherSignRecoderId"];
    this.courseCode = map["courseCode"];
    this.signUserNumber = map["signUserNumber"];

    this.teacherLongitude = map["teacherLongitude"];
    this.teacherLlatitude = map["teacherLlatitude"];
    this.teacherAddress = map["teacherAddress"];

    this.courseStatuesStr = map["courseStatuesStr"] ?? "";
    //课程状态  0 未上课  1 正在上课中  2上课完成
    this.courseStatues = map["courseStatues"] ?? 0;

    this.userCourseStatues = map["userCourseStatues"] ?? 0;
    this.userCourseStatuesStr = map["userCourseStatuesStr"] ?? "";

    this.timeNode = map["timeNode"] ?? 12;

    this.signRecoderId = map["signRecoderId"];
    this.noSignTips = map["noSignTips"];

    this.showTeacherTime = map["showTeacherTime"] ?? false;
    this.isForceLocation = map["isForceLocation"] ?? true;
    this.forceLocation = map["forceLocation"] ?? 0;

    this.userSignStartTime = map["userSignStartTime"];
    this.userSignEndTime = map["userSignEndTime"];

    this.teacherSignStartTime = map["teacherSignStartTime"];
    this.teacherSignEndTime = map["teacherSignEndTime"];

    this.showUserStartSign = map["showUserStartSign"] ?? false;
    this.showUserStartSignTips = map["showUserStartSignTips"] ?? true;
    this.showUserStartSignStr = map["showUserStartSignStr"] ?? "";

    this.showUserStartSignTips1 = map["showUserStartSignTips1"] ?? "";
    this.showUserStartSignTips2 = map["showUserStartSignTips2"] ?? "";
    this.showUserStartSignTips3 = map["showUserStartSignTips3"] ?? "";

    this.showUserEndSignStr = map["showUserEndSignStr"] ?? "";
    this.showUserEndSignTips1 = map["showUserEndSignTips1"] ?? "";
    this.showUserEndSignTips2 = map["showUserEndSignTips2"] ?? "";
    this.showUserEndSignTips3 = map["showUserEndSignTips3"] ?? "";
    this.showUserEndSignTips = map["showUserEndSignTips"] ?? true;

    this.showUserCodeSign = map["showUserCodeSign"] ?? false;
    this.showUserCodeEndSign = map["showUserCodeEndSign"] ?? false;

    this.showUserEndSign = map["showUserEndSign"] ?? false;

    this.showTeacherStartSign = map["showTeacherStartSign"] ?? false;
    this.showTeacherStartTips = map["showTeacherStartTips"] ?? false;
    this.showTeacherStartTips1 = map["showTeacherStartTips1"] ?? "";

    this.showTeacherEndTips = map["showTeacherEndTips"] ?? false;
    this.showTeacherEndTips1 = map["showTeacherEndTips1"] ?? "";

    this.showTeacherEndSign = map["showTeacherEndSign"] ?? false;

    this.teacherPeriod = map["teacherPeriod"] ?? 0;
    this.beginTime = map["beginTime"];
    this.endTime = map["endTime"];
    if (map["userEntity"] != null) {
      userEntity = UserBean.fromJson(map["userEntity"]);
    }
  }

  CourseAndTeacherBean.fromBeanVideoCourse(BeanVideoCourse beanVideoCourse) {}
}

//课程
class CourseBean {
  int courseId;
  int trainStartId;
  String courseName;
  String startTime;
  String updateTime;
  int studyStatues;

  List<CourseBean> courseList;

  CourseBean.fromJson(Map<String, dynamic> map) {
    this.trainStartId = map["trainStartId"];
    this.updateTime = map["updateTime"];
    this.courseId = map["courseId"];
    this.courseName = map["courseName"];
    this.startTime = map["startTime"];
    this.studyStatues = map["studyStatues"];
    List list = map["levelCourseList"];
    this.courseList = [];
    if (list != null) {
      list.forEach((element) {
        courseList.add(CourseBean.fromJson(element));
      });
    }
  }
}

class TrainCourseSignBean {
  int id;
  String courseCode;

  //签到状态 0 已签到 1已签退
  int statues;

  //签到时间
  String createTime;
  String signToTime;

  //签退时间
  String signUpTime;

  String lineCourseName;

  TrainCourseSignBean.fromJson(Map<String, dynamic> map) {
    this.id = map["id"];
    this.statues = map["statues"];
    this.courseCode = map["courseCode"];
    this.createTime = map["createTime"];
    this.lineCourseName = map["lineCourseName"];
    this.signToTime = map["signToTime"];
    this.signUpTime = map["signUpTime"];
  }
}

class TrainNumberBean {
  //进行中
  int trainNumber;

  //已完成
  int finishNumber;

  TrainNumberBean.fromJson(Map<String, dynamic> map) {
    this.trainNumber = map["trainNumber"];
    this.finishNumber = map["finishNumber"];
  }
}

class UserTrainStudyEntity {
  //进行中
  int trainId;

  //已完成
  int userId;

  /// 0 进行中未完成 1 已完成
  int statues = 0;

  String createTimeStr;
  String endTimeStr;
  String startTimeStr;

  //签退
  String signOffTimeStr;

  UserTrainStudyEntity.fromJson(Map<String, dynamic> map) {
    print("${map.toString()}");
    this.trainId = map["trainId"];
    this.userId = map["userId"];
    this.statues = map["statues"];

    this.createTimeStr = map["createTimeStr"];
    this.endTimeStr = map["endTimeStr"];
    this.startTimeStr = map["startTimeStr"];

    this.signOffTimeStr = map["signOffTimeStr"];
  }
}

class TrainBean {
  int trainId;
  int userId;
  int examId;
  int obtainScore;
  int extractingTimes;
  int averageScore;
  int rankNumber;

  UserTrainStudyEntity userTrainStudyEntity;
  String userTrainStudyTips;

  //班主任ID
  int teacherDirectorId;

  /// 状态 0 进行中未完成 1 已完成
  int trainFinishStatus = 0;
  String faceRecognition = "off";
  int faceRecognitionTime = 5;
  //视频课程
  List<BeanVideoCourse> videoCourseEntityList;

  /// <el-radio :label="0">待发布</el-radio>
  /// <el-radio :label="1">禁用</el-radio>
  /// <el-radio :label="2">删除</el-radio>
  /// <el-radio :label="9">未开始</el-radio>
  /// <el-radio :label="5">进行中</el-radio>
  /// <el-radio :label="6">已完成</el-radio>
  /// train_status
  int trainStatus;

  /// 是否启用培训签到 on 开启；off 不开启
  String openSign;

  String endTime;

  double rankIntegralNumber;

  String statisticsDate;
  String reamName;
  String userPost;
  String department;

  ///选择的部门 全部部门时为 null
  String selectDepartment;
  String trainName = '';
  String trainRemark = '';

  String approeTime;
  String commitTime;
  String createTime;
  String endStudyTime;
  String startStudyTime;
  String trainLine;

  String finishStr;

  ///是否显示参与考试
  int showTrainExam = 0;

  ///
  /// 是否显示 培训满意度测评表 0 默认不显示；1显示
  ///
  int showTrainDegree = 0;

  ///
  /// 是否显示 教师满意度测评表 0 默认不显示；1显示
  ///
  int showTeacherDegree = 0;

  ///
  /// 是否显示 培训考核结果 0 默认不显示；1显示
  ///
  int showCheckResult = 0;

  /// 是否显示显示合格审批  0 默认不显示；1显示
  int showExamApprove = 0;

  /*
  "approeTime": "2021-01-14 18:01:36",
			"commitTime": "2021-01-14 17:01:52",
			"createTime": "2021-01-14 16:47:24",
   */
  List<CourseAndTeacherBean> courseList;

  TrainBean.fromJson(Map<String, dynamic> map) {
    this.trainStatus = map["trainStatus"];
    this.trainId = map["trainId"];
    this.userId = map["userId"];
    this.examId = map["examId"];
    this.trainLine = map["trainLine"];
    this.endStudyTime = map["endStudyTime"];
    this.startStudyTime = map["startStudyTime"];
    this.teacherDirectorId = map["teacherDirectorId"];

    this.openSign = map["openSign"] ?? "off";

    this.faceRecognition = map["faceRecognition"] ?? 'off';
    this.faceRecognitionTime = map["faceRecognitionTime"] ?? 5;

    this.endTime = map["userEndTime"];
    this.showTrainExam = map["showTrainExam"] ?? 0;
    this.trainFinishStatus = map["trainFinishStatus"] ?? 0;

    this.showTrainDegree = map["showTrainDegree"] ?? 0;
    this.showTeacherDegree = map["showTeacherDegree"] ?? 0;
    this.showCheckResult = map["showCheckResult"] ?? 0;
    this.showExamApprove = map["showExamApprove"] ?? 0;

    this.obtainScore = map["obtainScore"];
    this.extractingTimes = map["extractingTimes"];
    this.averageScore = map["averageScore"];
    this.rankNumber = map["rankNumber"];

    this.rankIntegralNumber = map["rankIntegralNumber"];

    this.finishStr = map["finishStr"];

    this.statisticsDate = map["statisticsDate"];
    this.reamName = map["reamName"];
    this.userPost = map["userPost"];
    this.department = map["department"];

    this.commitTime = map["commitTime"];
    this.approeTime = map["approeTime"];
    this.createTime = map["createTime"];

    this.selectDepartment = map["selectDepartment"];
    this.trainName = map["trainName"] ?? '';
    this.trainRemark = map["trainRemark"] ?? '';

    List courseList = map["teacherAndCourselist"];
    this.courseList = [];
    if (courseList != null) {
      courseList.forEach((element) {
        this.courseList.add(CourseAndTeacherBean.fromJson(element));
      });
    }

    List videoCourseEntityList = map["videoCourseEntityList"];
    this.videoCourseEntityList = [];
    if (videoCourseEntityList != null) {
      videoCourseEntityList.forEach((element) {
        this.videoCourseEntityList.add(BeanVideoCourse.fromMap(element));
      });
    }

    userTrainStudyTips = map["userTrainStudyTips"];
    if (map["userTrainStudyEntity"] != null) {
      userTrainStudyEntity =
          UserTrainStudyEntity.fromJson(map["userTrainStudyEntity"]);
    }
  }
}

class TrainApproveBean {
  /*
  "id": 39,
			"trainId": 39,
			"userId": 1462,
			"approeStatues": 3,
			"approeTime": "2021-01-03 10:02:48",
			"createTime": "2021-01-02 01:40:26",
			"mineId": null,
			"reamName": "贺建红",
			"trainName": "测试第一个培训",
			"updateTime": "2021-01-03 10:02:48",
			"userName": "pingquan1"
   */
  int id;
  int trainId;
  int userId;
  int approeStatues;

  int examId;

  String approeTime;
  String createTime;
  String trainName;
  String commitTime;

  TrainApproveBean(this.trainId, this.createTime, {this.examId});

  TrainApproveBean.fromJson(Map<String, dynamic> map) {
    this.userId = map["userId"];
    this.trainId = map["trainId"];
    this.id = map["id"];
    this.examId = map["examId"];
    this.approeStatues = map["approeStatues"];

    this.approeTime = map["approeTime"];
    this.createTime = map["createTime"];
    this.trainName = map["trainName"];
    this.commitTime = map["commitTime"];
  }
}

class SignRecoderBean {
  int courseOneId;
  int courseTwoId;
  int id;
  int teacherUserId;
  int trainId;
  int trainStartId;
  int userId;
  String courseOneName;
  String courseTeacherName;
  String courseTwoName;
  String createTime;
  int pageIndex;
  String signBuTime;
  String signUpTime;
  String signToTime;
  int statues;
  String updateTime;

  //1 面授课程  2 在线课程
  int signType;
  String lineCourseName;
  int lineCourseId;

  static SignRecoderBean fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    SignRecoderBean beanTestBean = SignRecoderBean();
    beanTestBean.courseOneId = map['courseOneId'];
    beanTestBean.signType = map['signType'];
    beanTestBean.lineCourseName = map['lineCourseName'];
    beanTestBean.lineCourseId = map['lineCourseId'];
    beanTestBean.signToTime = map['signToTime'];
    beanTestBean.courseTwoId = map['courseTwoId'];
    beanTestBean.id = map['id'];
    beanTestBean.teacherUserId = map['teacherUserId'];
    beanTestBean.trainId = map['trainId'];
    beanTestBean.trainStartId = map['trainStartId'];
    beanTestBean.userId = map['userId'];
    beanTestBean.courseOneName = map['courseOneName'];
    beanTestBean.courseTeacherName = map['courseTeacherName'];
    beanTestBean.courseTwoName = map['courseTwoName'];
    beanTestBean.createTime = map['createTime'];
    beanTestBean.pageIndex = map['pageIndex'];
    beanTestBean.signBuTime = map['signBuTime'];
    beanTestBean.signUpTime = map['signUpTime'];
    beanTestBean.statues = map['statues'];
    beanTestBean.updateTime = map['updateTime'];
    return beanTestBean;
  }

  Map toJson() => {
        "courseOneId": courseOneId,
        "courseTwoId": courseTwoId,
        "id": id,
        "teacherUserId": teacherUserId,
        "trainId": trainId,
        "trainStartId": trainStartId,
        "userId": userId,
        "courseOneName": courseOneName,
        "courseTeacherName": courseTeacherName,
        "courseTwoName": courseTwoName,
        "createTime": createTime,
        "pageIndex": pageIndex,
        "signBuTime": signBuTime,
        "signUpTime": signUpTime,
        "statues": statues,
        "updateTime": updateTime,
      };
}

class DirectorTeacherWorkLog {
  int id;

  /// 班主任用户ID
  /// teacher_director_id
  int teacherDirectorId;
  int mineId;

  /// 班主任姓名
  String directorName;
  String idCard;
  String department;

  /// 状态 正常 0；1删除
  /// log_statues
  int logStatues;

  /// tran_id
  int trainId;
  String trainName;

  /// 工作内容
  String workContent;
  String createTime;

  ///天气
  String currentWeatherInfo;

  static DirectorTeacherWorkLog fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    DirectorTeacherWorkLog beanTestBean = DirectorTeacherWorkLog();
    beanTestBean.id = map['id'];
    beanTestBean.teacherDirectorId = map['teacherDirectorId'];
    beanTestBean.mineId = map['mineId'];
    beanTestBean.directorName = map['directorName'];
    beanTestBean.currentWeatherInfo = map["currentWeatherInfo"];
    beanTestBean.idCard = map['idCard'];
    beanTestBean.department = map['department'];
    beanTestBean.logStatues = map['logStatues'];
    beanTestBean.trainId = map['trainId'];
    beanTestBean.trainName = map['trainName'];
    beanTestBean.workContent = map['workContent'] ?? "";
    beanTestBean.createTime = map['createTime'];
    return beanTestBean;
  }
}

class TeacherTrainBean {
  int id;

  //教材
  String teacherBook;

  //教学内容
  String teacherContent;

  //学时
  int teacherPerio;

  //课程安排
  int timeNode;

  //时间
  String beginTime;

  String endTime;

  TrainBean trainBean;

  static TeacherTrainBean fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TeacherTrainBean beanTestBean = TeacherTrainBean();
    beanTestBean.id = map['id'];
    beanTestBean.teacherBook = map['teacherBook'];
    beanTestBean.teacherContent = map['teacherContent'];
    beanTestBean.teacherPerio = map['teacherPerio'];

    beanTestBean.timeNode = map["timeNode"];
    beanTestBean.beginTime = map["beginTime"];
    beanTestBean.endTime = map["endTime"];
    if (map["trainEntity"] != null) {
      beanTestBean.trainBean = TrainBean.fromJson(map["trainEntity"]);
    }
    return beanTestBean;
  }
}

class TrainUserCheckRecoderEntity {
  int id;
  int mineId;

  /// 培训ID
  int trainId;

  /// 用户ID
  int userId;
  String realName;
  String phone;
  String idCard;

  /// 出勤情况 15分
  /// attendance_number
  int attendanceNumber;

  /// 纪律执行
  /// discipline_number
  int disciplineNumber;

  /// 学习表现
  /// study_number
  int studyNumber;

  /// 实训表现
  /// practical_number
  int practicalNumber;

  /// 知识掌握
  /// knowledge_number
  int knowledgeNumber;

  /// 状态 0 未考评 1考评中  2考评完成
  int statues;

  /// 自我鉴定
  /// my_remark
  String myRemark;

  /// 班主任意见
  /// director_remark
  String directorRemark;

  /// 培训机构意见
  /// train_remark
  String trainRemark;

  /// 创建时间
  String createTime;

  /// 更新时间
  String updateTime;

  ///0 显示 1隐藏
  int showUpdateMyRemark = 0;

  UserBean userBean;

  static TrainUserCheckRecoderEntity fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TrainUserCheckRecoderEntity beanTestBean = TrainUserCheckRecoderEntity();
    beanTestBean.id = map['id'];
    beanTestBean.trainId = map['trainId'];
    beanTestBean.mineId = map['mineId'];
    beanTestBean.userId = map['userId'];

    beanTestBean.realName = map['realName'];
    beanTestBean.phone = map['phone'];
    beanTestBean.idCard = map['idCard'];

    beanTestBean.showUpdateMyRemark = map['showUpdateMyRemark'] ?? 0;

    beanTestBean.attendanceNumber = map["attendanceNumber"];
    beanTestBean.disciplineNumber = map["disciplineNumber"];
    beanTestBean.studyNumber = map["studyNumber"];
    beanTestBean.practicalNumber = map["practicalNumber"];
    beanTestBean.knowledgeNumber = map["knowledgeNumber"];

    beanTestBean.statues = map["statues"];

    beanTestBean.myRemark = map["myRemark"];
    beanTestBean.directorRemark = map["directorRemark"];
    beanTestBean.trainRemark = map["trainRemark"];

    beanTestBean.createTime = map["createTime"];
    beanTestBean.updateTime = map["updateTime"];

    if (map["userEntity"] != null) {
      beanTestBean.userBean = UserBean.fromJson(map["userEntity"]);
    }

    return beanTestBean;
  }
}

class TrainSynthesizeCheckReportEntity {
  int id;
  int mineId;

  /// 培训ID
  int trainId;

  /// 用户ID
  int userId;

  /// 状态 0 未考评 1考评中  2考评完成
  int statues;

  /// 第1自然段：简要介绍该期培训班的基本情况
  /// train_info
  String trainInfo;

  /// 介绍该期培训班培训学时的落实执行情况。
  /// train_period_info
  String trainPeriodInfo;

  /// 介绍该期培训班培训课程的落实执行情况。
  /// train_course_info
  String trainCourseInfo;

  /// 介绍该期培训班取得成效。
  /// train_result_info
  String trainResultInfo;

  /// 介绍该期培训班存在的问题。
  /// train_problem
  String trainProblem;

  /// 介绍下一步搞好培训班采取的措施。。
  /// train_plan
  String trainPlan;

  /// 创建时间
  String createTime;

  /// 更新时间
  String updateTime;

  int showUpdateMyRemark = 0;

  static TrainSynthesizeCheckReportEntity fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TrainSynthesizeCheckReportEntity beanTestBean =
        TrainSynthesizeCheckReportEntity();
    beanTestBean.id = map['id'];

    beanTestBean.trainInfo = map['trainInfo'];
    beanTestBean.trainPeriodInfo = map['trainPeriodInfo'];
    beanTestBean.trainCourseInfo = map['trainCourseInfo'];
    beanTestBean.trainResultInfo = map['trainResultInfo'];
    beanTestBean.trainProblem = map['trainProblem'];
    beanTestBean.trainPlan = map['trainPlan'];
    beanTestBean.showUpdateMyRemark = map['showUpdateMyRemark'] ?? 0;
    return beanTestBean;
  }
}

class TrainDegreeOfStatisfactionEntity {
  int id;
  int mineId;

  /// 培训ID
  int trainId;

  /// 用户ID
  int userId;

  /// 评价总分
  int attendanceNumber;

  /// 我的建议
  String myRemark;

  /// 我的建议
  String trainRemark;

  /// 创建时间
  String createTime;

  /// 更新时间
  String updateTime;

  /// 是否显示开始测评
  bool shoTeacherDegree = false;

  String shoTeacherDegreeMessage;

  int statues = 0;

  static TrainDegreeOfStatisfactionEntity fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TrainDegreeOfStatisfactionEntity beanTestBean =
        TrainDegreeOfStatisfactionEntity();
    beanTestBean.id = map['id'];

    beanTestBean.attendanceNumber = map['attendanceNumber'] ?? 0;
    beanTestBean.myRemark = map['myRemark'];
    beanTestBean.trainRemark = map['trainRemark'];
    beanTestBean.shoTeacherDegree = map['shoTeacherDegree'];
    beanTestBean.shoTeacherDegreeMessage = map['shoTeacherDegreeMessage'];

    beanTestBean.statues = map["statues"] ?? 0;
    beanTestBean.createTime = map['createTime'];
    beanTestBean.updateTime = map['updateTime'];
    return beanTestBean;
  }
}

class TrainTeacherEntity {
  int id;
  UserBean userBean;
  String teacherBook;
  int trainId;
  int teacherId;
  String teacherContent;

  static TrainTeacherEntity fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TrainTeacherEntity beanTestBean = TrainTeacherEntity();
    beanTestBean.id = map['id'];

    beanTestBean.id = map['id'];
    beanTestBean.trainId = map['trainId'];
    beanTestBean.teacherId = map['teacherUserId'];
    beanTestBean.teacherContent = map['teacherContent'];

    beanTestBean.teacherBook = map['teacherBook'];
    beanTestBean.userBean = UserBean.fromJson(map["userEntity"]);
    return beanTestBean;
  }
}

class TrainNotificationRecoderEntity {
  int id;

  int trainId;

  String trainName;
  String messageTitle;
  String messageContent;

  String createTime;

  /// 状态 0 未读 1已读
  int statues;

  ///培训方式  offline  线下讲师培训 ; online  线上课程学习
  String trainLine = "online";

  static TrainNotificationRecoderEntity fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TrainNotificationRecoderEntity beanTestBean =
        TrainNotificationRecoderEntity();
    beanTestBean.id = map['id'];

    beanTestBean.id = map['id'];
    beanTestBean.trainId = map['trainId'];
    beanTestBean.trainName = map['trainName'];
    beanTestBean.messageTitle = map['messageTitle'];
    beanTestBean.trainLine = map['trainLine'] ?? "online";

    beanTestBean.messageContent = map['messageContent'];
    beanTestBean.createTime = map["createTime"];
    beanTestBean.statues = map["statues"];
    return beanTestBean;
  }
}
